//
//  Common.h
//  WisdomStudy
//
//  Created by  androidlongs on 2017/8/26.
//  Copyright © 2017年  androidlongs. All rights reserved.
//




#ifndef Common_h
#define Common_h

//获得屏幕的宽高
#define  mainW [UIScreen mainScreen].bounds.size.width
#define  mainH [UIScreen mainScreen].bounds.size.height


#define IS_IPHONE_X (mainH == 812.0f) ? YES : NO

#define Height_NavContentBar 44.0f

#define Height_StatusBar (IS_IPHONE_X==YES)?44.0f: 20.0f

#define Height_NavBar   (IS_IPHONE_X==YES)?88.0f: 64.0f

#define Height_TabBar   (IS_IPHONE_X==YES)?83.0f: 49.0f

//判断设备型号
#define UI_IS_LANDSCAPE         ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight)
#define UI_IS_IPAD              ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define UI_IS_IPHONE            ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define UI_IS_IPHONE4           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height < 568.0)
#define UI_IS_IPHONE5           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define UI_IS_IPHONE6           (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
#define UI_IS_IPHONE6PLUS       (UI_IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0 || [[UIScreen mainScreen] bounds].size.width == 736.0) // Both orientations
#define UI_IS_IOS8_AND_HIGHER   ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0)








#define WeakSelf __weak typeof(self) weakSelf = self;
#define WeakObj(o) autoreleasepool{} __weak typeof(o) o##Weak = o;

//判断版本
#define IsIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0 ? YES : NO)

//选中的颜色 原来的绿色
#define baseWelcomeSelectColor [UIColor colorWithRed:0/255 green:198.0/255 blue:174.0/255 alpha:0.8f]
#define baseSelectColor [UIColor colorWithRed:52.0/255 green:158.0/255 blue:247.0/255 alpha:1.0f]
//后来的蓝色
#define baseButtonBackGroundColor [UIColor colorWithRed:52.0/255 green:158.0/255 blue:247.0/255 alpha:1.0f]
//字体黑色
#define baseTextColor [UIColor colorWithHexString:@"#212121"]
//弧度换角度
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)

#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif

//__FILE__ 宏在预编译时会替换成当前的源文件名
//__LINE__宏在预编译时会替换成当前的行号

#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"\n\n\n[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] ->   【 " fmt " 】\n"), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...);
#endif


#endif /* Common_h */


